void swap(int* left, int* right) {
    int temp;
    temp = *left;
    *left = *right;
    *right = temp;
}